package com.weasel.weixin.commons;

import com.weasel.helper.JsonHelper;
import org.apache.commons.lang.StringUtils;

/**
 * Created by Dylan on 2015/9/28.
 */
public class CommonResponse {


    protected String errcode;

    protected String errmsg;

    public String getErrcode() {
        return errcode;
    }

    public void setErrcode(String errcode) {
        this.errcode = errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public boolean isOK(){

        return StringUtils.equals(getErrcode(),"0") || null == getErrcode();
    }

    @Override
    public String toString() {
        return JsonHelper.toJsonString(this);
    }
}
